package com.jic.product.service;


import com.jic.common.base.vo.RestResult;
import com.jic.product.model.entity.MStore;
import com.jic.product.store.request.*;
import com.jic.product.store.response.MStoreResponse;

import java.util.List;

/**
 * 业务层接口
 */
public interface MStoreManageService {

    /**
     * 1.提交订单冻结
     * 用以计算 实体仓增减,虚拟仓增减,店铺增减冻结
     * @Param productId 商品Id
     * @Param storeId 商品所属 虚拟仓库;
     * @Param num 提交订单的数量;
     */
    public RestResult<Boolean> frozen(MStoreFrozenRequest mStoreSubmitRequest);


    /**
     * 2.提交订单增减
     * 用以计算 实体仓增减,虚拟仓增减,店铺增减冻结
     * @Param productId 商品Id
     * @Param storeId 商品所属 虚拟仓库;
     * @Param num 提交订单的数量;
     */
    public RestResult<Boolean> submit(MStoreSubmitRequest mStoreSubmitRequest);

    /**
     * 根据产品Id,获取所有的实体库列表
     * @param mStoreSubmitRequest
     * @return
     */
    public List<MStore> listMStoreInfoByOrderInfo(MStoreQueryRequest mStoreSubmitRequest);

    /**
     * 获取可售数量最多的实体仓列表;
     * @param request 请求参数
     * @return MStoreResponse 响应参数
     * author taozhouchuan
     * @date 2020-4-28 20:14:23
     */
    public MStore listMStoreOfMaxAvailable(MStoreQueryRequest request);

    /**
     * 获取当天发货量最少的的实体仓列表;
     * @param request 请求参数
     * @return MStoreResponse 响应参数
     * author taozhouchuan
     * @date 2020-4-28 20:14:23
     */
    public MStore listStoreOfMinDelivery(MStoreQueryRequest request);


    /**
     * 3.撤销操作
     * @param mStoreRecallRequest 请求撤销的操作;
     * @return boolean 值;
     */
    public boolean recall(MStoreRecallRequest mStoreRecallRequest);


    /**
     * 业务操作前,校验数据链的完整性:[实体仓库]-[虚拟仓库]-[台账]
     * @param mStoreRecallRequest
     * @return
     */
    public boolean validateBusinessCompleteness(MStoreRecallRequest mStoreRecallRequest);


    Boolean syncStock(MStoreShopSyncStockRequest request);

    com.jic.product.store.request.MStore getStoreByMerchantCode(MStoreReq request);
}
